<template>
  <iframe :src="src" frameborder="0"></iframe>
</template>

<script setup>
  import { ref } from 'vue'
  const src = ref('')
  function getQueryValue(search, queryName) {
    const reg = new RegExp(`(^|&)${queryName}=([^&]*)(&|$)`, 'i')
    const r = search.substr(1).match(reg)
   return decodeURI(r[2])
  }

  const iframeConfig = () => {
    
    const query = getQueryValue(window.location.search, 'page')
    console.log('window.location.search', query)
    src.value = `https://localhost:5173/${query}`
  }
  iframeConfig();
</script>